/**
 * @file utils_checksum.c
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2024-11-21
 * 
 * @copyright Copyright (c) 2024
 * 
 */

#include "utils_checksum.h"


/**
 * @brief 计算校验和
 * 
 * @param data 
 * @param len 
 * @return uint8_t 
 */
uint8_t utils_calucate_checksum(uint8_t *data, uint8_t len)
{
    uint8_t i;
    uint8_t sum = 0;

    for (i = 0; i < len; i++)
    {
        sum += data[i];
    }

    return sum;
}